====== Toolchain Options Setup ======
    for MIOS application development on Windows

\\
\\
**The technical jargon:**\\
This is //Part TWO of THREE// in a walkthrough on the process of developing [[MIOS]] Applications, primarily in C, [[how_to_mix_c_and_asm|but also in ASM]] utilising the [[http://www.ucapps.de/mios_c.html|MIOS C Wrapper]] or Microchip's [[http://www.microchip.com/|MPASM]]. The platform used will be [[http://www.codeblocks.org|Code::Blocks IDE]] on[[http://microsoft.com/windowsxp|Microsoft Windows XP]], and the applications will be built for both [[mios_c_simulator_-_debugger|AC-Sim (AudioCommander's C Simulator)]] compiled with [[http://gcc.gnu.org|GCC]] for [[http://www.mingw.org|MinGW]], and for the [[home#mbhpmidibox_hardware_platform|MIDIBox Hardware Platform (MBHP)]] compiled for [[http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=2042&param=en020453&pageId=74|PIC18F]] with [[http://sourceforge.net/projects/sdcc|SDCC]], assembled with [[http://sourceforge.net/projects/gputils|GPUtils]], using [[http://www.activestate.com|ActiveState]] [[http://www.activestate.com/Products/ActivePerl/?mp=1|ActivePerl]] to generate, and parse files for, the DOS-Console-based make batch file scripts, and [[http://miosstudio.midibox.org|MIOS Studio]] will be used for debugging on MBHP.

**Enough of that.**\\
You have probably come here from [[windows_toolchain_core|Part 1]]. This second part of the tutorial can actually be skipped completely if you wish. It contains setup instructions for two components of the toolchain. Select the ones you need, skip the ones you don't. Here's my advice:

  * MPLab - If you are going to be coding your apps in ASM, then you only need to install this one last application, and your toolchain is complete. If you are not sure if this is you, then it isn't.... Read on... You can always come back to this step later if you need to.
  * AC-Sim - If you will be developing applications in C, you may want to make use of AC-Sim. This is a tool that allows for a DOS-Console simulation of (part of) your application. This is not intended to be a MIDIbox on a PC, but rather to allow you to test and debug functions within your code which are complex, without having the need to constantly upload your application to your MIDIbox. In order to build the simulator app (*.exe) you will need MinGW. If you are not sure, and you have a few meg of diskspace to spare, I would recommend that you install this now, as the applications you install in Part 3 will auto-detect it's presence, which makes setup simple.

\\
\\

===== MPLab =====
MPLab is the toolchain supplied by Microchip for developing PIC ASM. It consists of MPIDE, MPASM and MPLink.\\


\\
  * Download the installer. The last version when this was written was [[http://ww1.microchip.com/downloads/en/DeviceDoc/MPLAB%207.62.zip|MPLAB IDE v7.62 Interim Release Zipped Installation]]. You may like to visit [[www.microchip.com]] and get the latest. The link will not be hard to find.
  * Install, taking the 'Complete' option. If you are experienced you may remove some unneeded components. If you aren't sure, use 'Complete'.
\\


\\
\\
\\
\\
** If you will only be coding in ASM**, the remainder of this tutorial is not relevant to you . If that’s the case, enjoy your coding experience! Bye!
\\
\\
** If you’re going to code in C**, or you’re unsure, carry on. You won’t break anything. :) 
\\
\\

===== MinGW =====
MinGW contains GCC which is used to compile the simulator \\
\\
  * [[http://sourceforge.net/project/showfiles.php?group_id=2435&package_id=240780&release_id=529741|Download the installer]]. Version 5.1.3 has tested OK.
  * Install, taking the 'Download and Install' option, and select the 'Candidate' package (use 'Current' if you have problems) and the 'Minimal' install type. It may be best to accept the default install path as MinGW doesn't like paths with spaces.
  * If the installer crashes while downloading just keep repeating the above until it completes.
\\

==== Environment Variables ====

Normally, the necessary directories are added to your PATH environment variable during the above installations. Sometimes, they aren't. Here's how to check it:

  * Minimise any open windows so that you can see the desktop. 
  * Right-click on 'My Computer', select 'Properties'.
  * Click on the 'Advanced' tab, then click 'Environment Variables'
  * Under either UserSystem variables, select the variable 'PATH' and click 'Edit'
  * Add this entry if it doesn't exist (Entries should be separated by semicolons):
    * ;C:\MinGW\bin
\\
\\
\\
====== Part 2 Complete ======
**If you made it this far**, please read on to Part 3 - [[windows_toolchain_codeblocks|Extend your toolchain with Code::Blocks and GDB]]
\\
\\